module.exports = {
  nav_name: '管理员设置', //生成导航菜单
  module_name: 'admin_manager',  //生成路径，与模块名相同
  api: `{
    page: commonPath + "/admin/user/pageSearch", //分页
    changeState: commonPath + '/admin/user/modifyState', //编辑
    detail: commonPath + '/admin/user/get', //详情,
    add: commonPath + '/admin/user/add', //添加
  }`, //接口
  table: {
    // isGenerate: "false", //false表示不生成页面
    table_name: "course_list",  //表格名
    nav_name: "管理员列表",  //导航名
    tipsText: "管理员设置 >> 管理员列表", //顶部文字
    //获取列表页面
    tableData: [
      //普通
      { title: '序号', name: 'index', type: "normal" },
      //图片
      {
        title: '封面',
        name: 'courseImg',
        type: "img",
        heightVal: "60",
        widthVal: "100",
      },
      //枚举
      {
        title: '状态',
        name: 'state',
        type: "opts",
        showName: "stateShow",
        showObj: `{
          "1": "上架",
          "2": "下架",
        }`
      },
      //插入代码
      {
        title: '是否精品',
        name: 'state',
        type: "innerCode",
        innerCode: `{{scope.row.isBoutique == '1' ? "是" : "否"}}`,
      },
    ],
    tableOpt: [
      //查看跳转
      // {
      //   type: "view",
      //   text: "查看",
      //   request: false,
      //   jump: "/member_manager_see_detail_member查看"
      // },
      //编辑跳转
      {
        type: "modify",
        text: "编辑",
        request: false,
        jump: "/member_manager_edit_member"
      },
      //删除功能
      {
        type: "del",
        text: "删除",
        request: true,
        url: "API.identify_manager.del",
        requestType: 'post',
        isSplitSearchString: 'true', //拼接查询字符串
      },
      //上下架功能
      {
        type: "changeState",
        text: "上架",
        request: true,
        url: "API.course_manager.course_list_changeState",
        requestType: 'post',
        params: `{id,  state: 1 }`, //必须为文本 状态 1上架 2下架
        methodNameTag: 'Open', //方法衔接拓展名 changeState Black
        showCondition: `scope.row.state == '2'`,  //展示条件，没有就不传或置为空
      },
      {
        type: "changeState",
        text: "下架",
        request: true,
        url: "API.course_manager.course_list_changeState",
        requestType: 'post',
        params: `{id,  state: 2 }`, //必须为文本
        methodNameTag: 'Close', //方法衔接拓展名 changeState Black
        showCondition: `scope.row.state == '1'`,  //展示条件，没有就不传或置为空
      },
      // 改变黑名单状态
      // {
      //   type: "changeState",
      //   text: "加入黑名单",
      //   request: true,
      //   url: "API.member_manager.changeState",
      //   requestType: 'post',
      //   params: `{id,  state: 2 }`, //必须为文本
      //   methodNameTag: 'Black', //方法衔接拓展名
      // },
    ],
    search: {
      contentArr: {
        //查找普通
        input1: { labelName: '账号名', inputName: 'tel' },
        input2: { labelName: '姓名', inputName: 'realName' },
        //查找下拉
        select1: {
          labelName: '性别', //输入标题
          inputName: 'sex',  //输入绑定的变量
          selectOptsName: "sexOpts",  //下拉枚举名
          selectOptsArr: `[
            { value: "M", label: "男" },
            { value: "F", label: "女" },
            { value: "", label: "全部" },
          ],
          `, //选项数组
        },
        //查找日期
        date1: {
          labelName: '注册时间',
          inputName: 'registerTime',
          dateConfig: {
            startDateName: 'registerStartDate',
            endDateName: 'registerEndDate',
            dateChangeMethodsName: 'handleRegisterDateChange'
          }
        },
      },
      //查找按钮的文字
      searchBtn: {
        text: "查询", //链接与table请求接口相同，不做另外配置
      },
      //添加按钮
      addBtn: {
        //搜索栏具有添加功能按钮时，设置此字段
        type: "add",
        text: "添加",
        request: false,
        jump: "/member_manager_add_page", //添加的跳转按钮
      }
    },

    //额外请求
    extraRequest: {
      dataCode: [
        "roleOpts"
      ],
      methodsCode: [
        {
          //每次只能发送一个请求，可拼接opt和show两个字段，
          explainText: "管理员角色获取", //文字注释
          type: "opts&&shows",  //表示选项类型格式，value, label
          methodName: "getRoleData",  //方法名
          api: "API.admin_manager.role_page",  //方法接口
          optsName: "roleOpts",  //选项名
          showName: "roleShow",  //展示名
          params: `{
            "pageIndex": 1,
            "pageSize": 100,
          }`,  //请求参数
          optsConfig: {
            label: "roleName",
            value: "id"
          },  //选项的拼接
          showConfig: {
            key: "id",
            value: "roleName"
          },  //展示的拼接
        }
      ]
    },

  },

  //添加页面
  add_page: {
    // isGenerate: "false", //false表示不生成页面
    add_page_name: "add_course_sort",  //页面名字，用来区分不同添加页面，默认为add_page，尽量短些,要拼接路由
    tipsText: "会员管理 >> xx", //顶部提示
    formData: {
      // titleText: "请填写管理员相关信息",
      //输入
      input1: {
        labelName: '注册手机号',
        inputName: 'tel',
        isNeed: 'true',
      },
      //选择
      select1: {
        labelName: '性别',
        inputName: 'sex',  //输入绑定的变量
        selectOptsName: "sexOpts",
        selectOptsArr: `[
            { value: "M", label: "男" },
            { value: "F", label: "女" },
            { value: "", label: "全部"},
          ],
          `, //选项数组
        isNeed: 'true',
      },
      //图片上传
      uploadImg1: {
        labelName: "轮播图上传",
        inputName: "testImgStr",
        type: "many", //type: "single"
        countLimit: "1",
        uploadMethod: "handleUploadBanner",
        isNeed: 'true',
      },
      //多行文本
      textarea1: {
        labelName: '课程简介',
        inputName: 'tel',
        isNeed: 'true',
        rows: "5",
        width: "360", //自动补全px
        isNeed: 'true',
      },
      //单选
      radio1: {
        labelName: '课程类型',
        inputName: 'courseState',
        radioOpts: [
          { value: "1", label: "图文" },
          { value: "2", label: "视频" },
        ], //这是个同select结构的枚举,但为对象格式
        isNeed: 'true',
        radioWidth: '60px',
        // defaultValue: "", //初始默认值
      },
      //富文本 （在修改回调内可添加固定样式）
      richText1: {
        labelName: '课程内容(图文)',
        inputName: 'richTextCourse',
        isNeed: 'true',
        minHeight: "180", //高度
        uploadApi: "API.common.upload",
        editContentChangeMethodName: "handleBgEditChange", //改变方法
        isNeed: 'true',
      },
      // //三级联动组件
      // address1: {
      //   label: "地址选择",
      //   inputName: "",
      // }
    },
    addBtn: {
      text: '添加',
      url: "API.member_manager.add"
    }, //
    editBtn: {
      text: '编辑',
      detailUrl: "API.member_manager.detail",
      editUrl: "API.member_manager.edit",
      jump: '/member_page_page'
    },
    cancelBtn: { text: "取消" }, //
  },

  //详情页面
  detail_page: {
    detail_page_name: "user_dynamic_detail",
    detail_api: "API.dynamic_manager.detail",
    request_params: `{
        id,
      }`,
    tipsText: "动态管理 >> 用户动态",
    formData: {
      // titleText: "请填写管理员相关信息",
      item1: {
        labelName: "动态内容",
        inputName: 'remark',
        type: "normal",
        frontTips: "", //后面的说明
        behindTips: "", //前面的说明
      },

      item2: {
        labelName: '动态图片',
        inputName: 'photo',
        type: "img",
      },
      item3: {
        labelName: '动态类型',
        inputName: 'type',
        type: "innerCode",
        frontTips: "", //后面的说明
        behindTips: "", //前面的说明
        innerCode: `{{formData.forwardType ? "转载" : "原创"}}`,
      },
      item4: {
        labelName: '用户昵称',
        inputName: 'company',
        frontTips: "", //后面的说明
        behindTips: "", //前面的说明
      },
      item4: {
        labelName: '发布时间',
        inputName: 'gmtModified',
        frontTips: "", //后面的说明
        behindTips: "", //前面的说明
      },
      //选项展示
      item4: {
        labelName: '打款状态',
        inputName: 'moneyState',
        type: "opts",
        optShowName: "moneyStateShow",
        optShowStr: `{}`,
        frontTips: "", //后面的说明
        behindTips: "", //前面的说明
      },
    },
  },

}
